import { pathOr } from 'ramda';

const CATEGOTY_SECURITY_STATUS = {
	unknown: '- -',
	safe: {
		weakness: '安全',
		aviliable: '正常',
		asset: '无更新',
		securityEvent: '安全',
		content: '安全',
	},
	warning: {
		weakness: '威胁',
		aviliable: '异常',
		asset: '更新',
		securityEvent: '威胁',
		content: '威胁',
	},
};

export default function categorySecurityStatus({
	category,
	status,
	warningCount,
}) {
	let ret = pathOr('- -', [status, category], CATEGOTY_SECURITY_STATUS);
	if (ret && warningCount && status === 'warning') {
		ret = `${warningCount}个${ret}`;
	}
	return ret;
}
